package com.qf.product.controller;

import com.qf.common.dto.product.CategoryDto;
import com.qf.product.service.CategoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author KING
 * @ClassName: com.qf.product.controller.CategoryController
 * @Description: 该类的功能描述
 * @date: 2021/11/10 21:58
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Resource
    private CategoryService categoryService;

    @GetMapping("/list")
    public List<CategoryDto> getCategories() {
        List<CategoryDto> categoryDtoList = categoryService.getCategories();
        return categoryDtoList;
    }
}
